﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse.Net.Forums
{
    using System;
    using System.Data.Linq.Mapping;
    using Microsoft.Phone.Data.Linq.Mapping;

    /// <summary>On Windows Phone 7.5, LINQ to SQL automatically creates a table named __VERSION and also automatically
    /// maintains its rows during schema upgrades. This entity class duplicates this functionality on the desktop.
    /// </summary>
    [Table(Name = "__VERSION")]
    [Index(Name = "IX_SchemaVersion", Columns = "SchemaVersion")]
    internal sealed class Version
    {
        [Column]
        internal int SchemaVersion { get; set; }

        [Column(DbType = "DATETIME DEFAULT (GETDATE()) NOT NULL", IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
        internal DateTime DateUpdated { get; set; }
    }
}
